<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        $(function(){

            // 方式1
            // $('#btn1').click(function(){
            //     console.log(111)
            // })

            // 方式2
            $('#btn1').on('click', function(){
                console.log(222)
            })

        })
    </script>
</head>
<body>
    <button type="button" id="btn1">按钮1</button>
</body>
</html>